﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Books.Migrations
{
    public partial class gou1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Gtype",
                table: "gous");

            migrationBuilder.DropColumn(
                name: "PublishDate",
                table: "gous");

            migrationBuilder.RenameColumn(
                name: "Price",
                table: "gous",
                newName: "price");

            migrationBuilder.RenameColumn(
                name: "Num",
                table: "gous",
                newName: "num");

            migrationBuilder.RenameColumn(
                name: "GName",
                table: "gous",
                newName: "gname");

            migrationBuilder.RenameColumn(
                name: "Tupian",
                table: "gous",
                newName: "gtu");

            migrationBuilder.AlterColumn<string>(
                name: "price",
                table: "gous",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(float),
                oldType: "real");

            migrationBuilder.AddColumn<int>(
                name: "state",
                table: "gous",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "state",
                table: "gous");

            migrationBuilder.RenameColumn(
                name: "price",
                table: "gous",
                newName: "Price");

            migrationBuilder.RenameColumn(
                name: "num",
                table: "gous",
                newName: "Num");

            migrationBuilder.RenameColumn(
                name: "gname",
                table: "gous",
                newName: "GName");

            migrationBuilder.RenameColumn(
                name: "gtu",
                table: "gous",
                newName: "Tupian");

            migrationBuilder.AlterColumn<float>(
                name: "Price",
                table: "gous",
                type: "real",
                nullable: false,
                defaultValue: 0f,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "Gtype",
                table: "gous",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<DateTime>(
                name: "PublishDate",
                table: "gous",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
        }
    }
}
